package main.java.indi.zyj.c150.recursion;

public class _04_ShellSort {

    public static void main(String[] args) {

    }


    static int[] ShellSort(int[] arr){

        for (int d = arr.length; d > 0; d = d / 2) {
            for (int i = d; i < arr.length; i++) {
                for (int j = i - d; j >= 0 ; j -= d) {
                    if (arr[j] < arr[j + d]){
                        int temp = arr[j];
                        arr[j] = arr[j + d];
                        arr[j + d] = temp;
                    }
                }
            }
        }

        return arr;

    }

}
